package com.jsoft.service.impl;

import com.jsoft.dao.UserDao;
import com.jsoft.dao.impl.UserDaoImpl;
import com.jsoft.service.UserService;

/**
 * 用户表的接口的实现类
 * @author : yhx
 * @version : 1.0
 * @date : 2023/2/19
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();

    @Override
    public int loginUser(String account, String password){
        int res=0;
        try {
            res = userDao.loginUser(account, password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return res;
    }


    /**
     * 根据account查询企业id
     * @param account user账号
     * @return 企业id
     */
    @Override
    public String findEnterpriseIdByUserAccount(String account) {
        try {
            return userDao.findEnterpriseIdByUserAccount(account);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
